<!-- 管理员用户组新增和编辑页面 -->
<extend name="Public/base" />
<block name="body">
<style>
.checkbox input[type="checkbox"], .checkbox-inline input[type="checkbox"], .radio input[type="radio"], .radio-inline input[type="radio"]{
	margin-left: -15px;

}
label{
	padding-left:10px;
	font-size:15px;
}
</style>


<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>编辑系列图书</h2>
    </div>

				<form action="{:U('ReadSeries/addBook')}" enctype="application/x-www-form-urlencoded" method="POST" class="form-horizontal auth-form">
					<volist name="book" id="vo" key="k">
						<dl class="checkmod">
							<dt class="hd">
								<!-- <label class="checkbox"><input class="auth_rules rules_all" type="checkbox" value="<?php echo $main_rules[$node['url']] ?>">{$vo.categoryString}</label>-->
								{$vo.categoryString}
							</dt>
							<dd class="bd">
								<present name="vo['book']">
								<volist name="vo['book']" id="child" >
                                  <label class="checkbox">
                                    <input class="auth_rules rules_row" type="checkbox" name="bookid[]" value="{$child.id}"/>{$child.bookname}
                                  </label>
								</volist>
								</present>
							</dd>
						</dl>
					</volist>

			        <input type="hidden" name="seriesid" value="{:I('seriesid')}" />
                    <button type="submit" class="btn submit-btn ajax-post" target-form="auth-form">确 定</button>
                    <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
			    </form>
			</div>
</block>
<block name="script">
<script type="text/javascript" src="__STATIC__/qtip/jquery.qtip.min.js"></script>
<link rel="stylesheet" type="text/css" href="__STATIC__/qtip/jquery.qtip.min.css" media="all">
<script type="text/javascript" charset="utf-8">
    +function($){
        var rules = [{$bookid}];
        $('.auth_rules').each(function(){
            if( $.inArray( parseInt(this.value,10),rules )>-1 ){
                $(this).prop('checked',true);
            }
            if(this.value==''){
                $(this).closest('span').remove();
            }
        });

        //全选节点
        $('.rules_all').on('change',function(){
            $(this).closest('dl').find('dd').find('input').prop('checked',this.checked);
        });
        $('.rules_row').on('change',function(){
            $(this).closest('.rule_check').find('.child_row').find('input').prop('checked',this.checked);
        });

        $('.checkbox').each(function(){
            $(this).qtip({
                content: {
                    text: $(this).attr('title'),
                    title: $(this).text()
                },
                position: {
                    my: 'bottom center',
                    at: 'top center',
                    target: $(this)
                },
                style: {
                    classes: 'qtip-dark',
                    tip: {
                        corner: true,
                        mimic: false,
                        width: 10,
                        height: 10
                    }
                }
            });
        });

        $('select[name=group]').change(function(){
			location.href = this.value;
        });
        //导航高亮
        highlight_subnav('{:U('ReadSeries/index')}');
    }(jQuery);
</script>
</block>
